Method for encoding/decoding an intra-picture prediction mode using two intra- prediction mode candidate, and apparatus using such a method

ABSTRACT

The method for decoding an intra-picture prediction mode includes the steps of: determining whether the intra-picture prediction mode of a current prediction unit is identical to a first intra-picture prediction mode candidate or a second intra-picture prediction mode candidate based on bit information; and when the intra-picture prediction mode of the current prediction unit is identical to the first intra-picture prediction mode candidate and/or to the second intra-picture prediction mode candidate, determining whether the first intra-picture prediction mode candidate or the second intra-picture prediction mode candidate is identical to the intra-picture prediction mode of the current prediction unit on the basis of additional bit information, and decoding the intra-picture prediction mode of the current prediction unit.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is the National Stage Entry of InternationalApplication PCT/KR2012/007305, filed on Sep. 12, 2012, and claimspriority from and the benefit of Korean Patent Application No.10-2011-0101816, filed on Oct. 6, 2011, which are incorporated herein byreference for all purposes as if fully set forth herein.

BACKGROUND

1. Field

The present invention relates to an encoding/decoding method andapparatus, and more particularly, an intra-prediction modeencoding/decoding method using two candidate intra-prediction modes andan apparatus using the same.

2. Discussion of the Background

Recently, demand for high resolution and high quality images such as ahigh definition (HD) image and an ultra-high definition (UHD) image havebeen increased in various applications fields. As video data has higherresolution and higher quality, an amount of data is increased, relativeto existing video data, and thus, transmission of video data by using amedium such as an existing wired/wireless a wide-band circuit or byusing an existing storage medium increases transmission costs andstorage costs. In order to address the above problems arising as videodata has higher resolution and higher quality, highly efficient videocompression techniques may be utilized.

Video compression techniques include various techniques such as aninter-prediction technique of predicting pixel values included in acurrent picture from a previous or subsequent picture of the currentpicture, an intra-prediction technique of predicting pixel valuesincluded in a current picture by using pixel information of the currentpicture, an entropy encoding technique of allocating a short sign to avalue having high appearance frequency and allocating a long sign to avalue having low appearance frequency, and the like, and video data maybe effectively compressed and transmitted or stored by using such videocompression techniques.

SUMMARY

An aspect of the present invention is to provide a video decoding methodto perform intra-prediction based on a fixed number of candidateintra-prediction modes to increase a video coding efficiency.

Another aspect of the present invention is to provide an apparatus ofperforming a video decoding method to perform intra-prediction based ona fixed number of candidate intra-prediction modes to increase a videocoding efficiency.

An embodiment of the present invention provides an intra-prediction modedecoding method may include: determining whether an intra-predictionmode of a current prediction unit (PU) is identical to a first candidateintra-prediction mode or a second candidate intra-prediction mode basedon n-bit information; and when the intra-prediction mode of the currentPU is identical to at least one of the first candidate intra-predictionmode and the second candidate intra-prediction mode, determining whichone of the first candidate intra-prediction mode and the secondcandidate intra-prediction mode, the intra-prediction mode of thecurrent PU is identical to, based on additional m-bit information, anddecoding the intra-prediction mode of the current PU. Theintra-prediction mode decoding method may further include: when theintra-prediction mode of the current PU is not identical to at least oneof the first candidate intra-prediction mode and the second candidateintra-prediction mode, decoding the intra-prediction mode of the currentPU based on additional bit specifying remaining intra-prediction modeinformation. The intra-prediction mode decoding method may furtherinclude: when the intra-prediction mode value of the current PU isgreater than at least one of the first candidate intra-prediction modevalue and the second candidate intra-prediction mode value, changing acodeword mapped to the intra-prediction mode value of the current PU.

When at least one of the first candidate intra-prediction mode and thesecond candidate intra-prediction mode is not derived from a neighbor PUof the current PU, a planar mode and a DC mode are sequentially set toat least one of the first candidate intra-prediction mode and the secondcandidate intra-prediction mode not derived from the neighbor PU of thecurrent PU, so that the first candidate intra-prediction mode and thesecond candidate intra-prediction mode have different intra-predictionmode values. When a first neighbor PU and a second neighbor PU of thecurrent PU are available neighbor PUs, and intra-prediction mode valuesof the first neighbor PUs and the second neighbor PU is identical, anintra-prediction mode value of the first neighbor PU or anintra-prediction mode value of the second neighbor PU is set to a firstcandidate intra-prediction mode, and when one of the first neighbor PUand the second neighbor PU is available, an intra-prediction mode valueof the available neighbor PU may be set as a first candidateintra-prediction mode, and when the first candidate intra-predictionmode is not a planar mode, the second candidate intra-prediction modemay be set as the planar mode, and when the first candidateintra-prediction mode is the planar mode, the second candidateintra-prediction mode may be set as a DC mode. When neither of the firstneighbor PU and the second neighbor PU of the current PU is available,the first candidate intra-prediction mode may be set as the planar modeand the second candidate intra-prediction mode may be set as the DCmode. The intra-prediction mode decoding method may further include: ifthe number of intra-prediction modes used in the current PU is equal toor smaller than a predetermined number, calculating intra-predictionmode information of the current PU based on a codeword directly mappedto the intra-prediction mode, without determining the first candidateintra-prediction mode and the second candidate intra-prediction mode.The determining of whether the intra-prediction mode of the current PUis identical to the first candidate intra-prediction mode or the secondcandidate intra-prediction mode based on n-bit information may include:when at least one of the first candidate intra-prediction mode value andthe second candidate intra-prediction mode value is greater than thenumber of intra-prediction modes available in the current PU, mapping atleast one candidate intra-prediction mode value greater than the numberof intra-prediction modes available in the current PU to theintra-prediction mode value available in the current PU by using apredetermined mapping table. The predetermined mapping table may be setso that a probability that at least one candidate intra-prediction modevalue greater than the number of intra-prediction modes available in thecurrent PU is mapped to the planar mode is high. The predeterminedmapping table may be set so that a probability that at least onecandidate intra-prediction mode value greater than the number ofintra-prediction modes available in the current PU is mapped to the DCmode is high. n and m may be 1.

Another embodiment of the present invention provides a decoder mayinclude: an entropy decoding module configured to decode informationregarding whether an intra-prediction mode of a current prediction unit(PU) is identical to a first candidate intra-prediction mode or a secondcandidate intra-prediction mode based on n-bit information included in apredetermined bit stream, decode information regarding as to which oneof the first candidate intra-prediction mode and the second candidateintra-prediction mode, the intra-prediction mode of the current PU isidentical to, based on additional m-bit information, when theintra-prediction mode of the current PU is identical to at least one ofthe first candidate intra-prediction mode and the second candidateintra-prediction mode, and decode the intra-prediction mode of thecurrent PU based on an additional bit specifying remainingintra-prediction mode information, when the intra-prediction mode of thecurrent PU is not identical to at least one of the first candidateintra-prediction mode and the second candidate intra-prediction mode;and a prediction module configured to perform intra-prediction based onthe intra-prediction mode of the current PU decoded by the entropydecoding module. When at least one of the first candidateintra-prediction mode and the second candidate intra-prediction mode arenot derived from a neighbor PU of the current PU, a planar mode and a DCmode are sequentially set to at least one of the first candidateintra-prediction mode and the second candidate intra-prediction mode notderived from the neighbor PU of the current PU such that the firstcandidate intra-prediction mode and the second candidateintra-prediction mode have different intra-prediction mode values. Afirst neighbor PU and a second neighbor PU of the current PU areavailable neighbor PUs, and the first intra-prediction mode values ofthe available neighbor PU and the second neighbor PU is identical, anintra-prediction mode value of the first neighbor PU or anintra-prediction mode value of the second neighbor PU is set to a firstcandidate intra-prediction mode, and when one of the first neighbor PUand the second neighbor PU is available, an intra-prediction mode valueof the available neighbor PU may be set as a first candidateintra-prediction mode, and when the first candidate intra-predictionmode is not a planar mode, the second candidate intra-prediction modemay be set as the planar mode, and when the first candidateintra-prediction mode is the planar mode, the second candidateintra-prediction mode may be set as a DC mode. When at least one of thefirst candidate intra-prediction mode value and the second candidateintra-prediction mode value is greater than the number ofintra-prediction modes available in the current PU, the predictionmodule may map at least one candidate intra-prediction mode valuegreater than the number of the intra-prediction modes available in thecurrent PU to the intra-prediction mode value available in the currentPU to perform intra-prediction on the current PU. The predeterminedmapping table may be set so that a probability that at least onecandidate intra-prediction mode value greater than the number ofintra-prediction modes available in the current PU is set mapped to theplanar mode is high. n and m may be 1.

As described above, according to the intra-prediction modeencoding/decoding method using two candidate intra-prediction modes andan apparatus using the same, an intra-prediction mode of a currentprediction unit (PU) may be expressed by using a short codeword and, byspecifying the intra-prediction mode of the current PU by using a fixednumber of candidate intra-prediction modes, coding efficiency may beenhanced and complexity may be reduced.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to an embodiment of the present invention.

FIG. 2 is a block diagram illustrating a video decoder according toanother embodiment of the present invention.

FIG. 3 is a conceptual view illustrating a method for encoding anintra-prediction mode of a current prediction unit (PU) according toanother embodiment of the present invention.

FIG. 4 is a conceptual view illustrating a method of determiningavailability of neighbor prediction units according to anotherembodiment of the present invention.

FIG. 5 is a flow chart illustrating a method of changing anintra-prediction mode of a neighbor prediction unit based on a currentprediction unit according to another embodiment of the presentinvention.

FIG. 6 is a flow chart illustrating a method of generating a firstcandidate intra prediction mode and a second intra prediction modeaccording to another embodiment of the present invention.

FIG. 7 is a flow chart illustrating a method of mapping information of acurrent prediction mode to codeword according to another embodiment ofthe present invention.

FIG. 8 is a flow chart illustrating a method of decoding a currentintra-prediction mode according to another embodiment of the presentinvention.

DETAILED DESCRIPTION OF THE ILLUSTRATED EMBODIMENTS

The present invention may be modified variably and may have variousembodiments, particular examples of which will be illustrated indrawings and described in detail. However, it is to be understood thatthe present invention is not limited to a specific disclosed form, butincludes all modifications, equivalents, and substitutions withoutdeparting from the scope and spirit of the present invention. Indescribing drawings, like numbers refer to like elements.

While terms such as “first” and “second,” etc., may be used to describevarious components, such components must not be understood as beinglimited to the above terms. The above terms are used only to distinguishone component from another. For example, a first component may bereferred to as a second component without departing from the scope ofrights of the present invention, and likewise a second component may bereferred to as a first component. Terms of “and/or” include acombination of items described in relation to plural forms or any one ofitems described in relation to plural forms.

It is to be understood that when one element is referred to as being“connected to” or “coupled to” another element, it may be connecteddirectly to or coupled directly to another element or be connected to orcoupled to another element, having the other element intervening therebetween. On the other hand, it is to be understood that when one elementis referred to as being “connected directly to” or “coupled directly to”another element, it may be connected to or coupled to another elementwithout the other element intervening there between. Other expressionsdescribing a relationship between components, that is, “between”,“directly between”, “neighboring to”, “directly neighboring to” and thelike, should be similarly interpreted.

Terms used in the present specification are used only in order todescribe specific embodiments rather than limiting the presentinvention. Singular forms are intended to include plural forms unlessthe context clearly indicates otherwise. It will be further understoodthat the terms “comprises” or “have” used in this specification, specifythe presence of stated features, steps, operations, components, parts,or a combination thereof, but do not preclude the presence or additionof one or more other features, numerals, steps, operations, components,parts, or a combination thereof.

Hereinafter, the embodiments of the present invention will be describedwith reference to the accompanying drawings, in which like numbers referto like elements throughout, and a redundant description of the sameelements will be omitted.

FIG. 1 is a block diagram illustrating a video encoding apparatusaccording to an embodiment of the present invention.

Referring to FIG. 1, the video encoding apparatus 100 may include apicture partitioning module 105, a prediction module 110, a transformmodule 115, a quantization module 120, a rearrangement module 125, anentropy encoding module 130, a dequantization module 135, aninverse-transform module 140, a filter module 145, and a memory 150.

The elements in FIG. 1 are illustrated independently to denote mutuallydifferent characteristic functions in the video encoding apparatus,which does not mean that each element is configured as separatedhardware or a single software constituent unit. Namely, the elements arearranged as individual elements for the description purpose, and atleast two of the elements may be incorporated into a single element or asingle element may be divided into a plurality of elements to performfunctions, and an embodiment in which elements are integrated or anembodiment in which an element is divided may be included in coverage ofthe present invention as long as it is not departed from the scope andspirit of the present invention.

Also, some of the elements may be optional to simply improveperformance, rather than essential ones to perform an intrinsic functionin the present invention. The present invention may be implemented byincluding only requisite elements for implementing the essence of thepresent invention, excluding element(s) used to merely enhanceperformance, and a structure including only the essential elements,excluding selective elements used to merely enhance performance may alsobe included in coverage of the present invention.

The picture partitioning module 105 may partition input picture into atleast one processing unit. In this case, the processing unit may be aprediction unit (PU), a transform unit (TU), or a coding unit (CU). Thepicture partitioning module 105 may partition a single picture into aplurality of combinations of coding unit (CU), prediction unit (PU), andtransform unit (TU) and select one of combinations of CU, PU, and TUbased on a predetermined reference (for example, a cost function), toencode a picture.

For example, a picture may be partitioned into a plurality of codingunits (CUs). In order to partition a picture into CUs, a recursive treestructure such as a quad tree structure may be used. A CU to bepartitioned into coding units based on a single picture or a CU having amaximum size as a root may be partitioned with child nodes correspondingto the number of partitioned CUs. A CU that may not be partitioned anymore according to a predetermined limitation is a leaf node. Namely, ina case in which a single CU is partitioned into only square units, thesingle CU may be partitioned into a maximum of four different CUs.

In the embodiment described hereinafter, a CU may also be referred to aunit for decoding, as well as a unit for encoding.

A prediction unit (PU) may be partitioned into at least one square orrectangular shape having the same size within a single CU. Further, aplurality of PUs partitioned from a single CU have a different shapeeach other.

In generating a PU performing intra-prediction based on a CU, if it isnot a minimum CU, intra-prediction may be performed without partitioninginto a plurality of PUs (N×N).

The prediction module 110 may include an inter-prediction moduleperforming inter-prediction and an intra-prediction module performingintra-prediction. Whether inter-prediction or intra-prediction appliedwith respect to a PU may be determined, and detailed information (forexample, an intra-prediction mode, a motion vector, a reference picture,and the like) corresponding to each prediction method may be determined.Here, a processing unit for performing prediction and a processing unitfor determining a prediction method and specific content may bedifferent. For example, a prediction method, a prediction mode, or thelike, may be determined by a prediction unit (PU), and prediction may beperformed by a transform unit (TU). A residual value (residual block)between a generated prediction block and an original block may be inputto the transform module 115. Also, prediction mode information, motionvector information, and the like, used for prediction may be encoded, aswell as the residual value, by the entropy encoding module 130 andtransmitted to a decoder. In case of using a specific encoding mode, theoriginal block may be encoded as it is and transmitted to a decoder,without generating a prediction block through the prediction module 110.

The inter-prediction module may predict a PU based on information of atleast one picture among a previous picture or a subsequent picture of acurrent picture. The inter-prediction module may include a referencepicture interpolation module, a motion estimation module, and a motioncompensation module.

The reference picture interpolation module may receive reference pictureinformation from the memory 150 and generate pixel information belowinteger pixels from the reference picture. In case of a luma pixel, aDCT-based 8-tap interpolation filter having different filtercoefficients to generate pixel information below integer pixels by ¼pixels may be used. In case of a chroma pixel, a DCT-based 4-tapinterpolation filter having different filter coefficients to generatepixel information below integer pixels by ⅛ pixels may be used.

The motion estimation module may perform motion estimation based on areference picture interpolated by the reference picture interpolationmodule. In order to derive a motion vector, various methods such as afull search-based block matching algorithm (FBMA), a three step search(TSS), a new three-step search algorithm (NTS), or the like, may beused. A motion vector may have a motion vector value in units of ½ or ¼pixels based on interpolated pixels. The motion estimation module maypredict a current prediction unit (PU) by using different motionprediction methods. Various methods such as a skip method, a mergemethod, an advanced motion vector prediction (AMVP) method, and thelike, may be used as a motion prediction method.

The intra-prediction unit may generate a PU based on reference pixelinformation neighboring a current block as pixel information within acurrent picture. When a neighbor block of a current PU is a block onwhich inter-prediction has been performed and then a reference pixel isa pixel on which inter-prediction has been performed, a reference pixelincluded in the block on which inter-prediction has been performed maybe replaced with reference pixel information of a neighbor block onwhich intra-prediction has been performed. That is, when a referencepixel is not available, the unavailable reference pixel information maybe replaced with at least one reference pixel among available referencepixels.

In intra-prediction, a prediction mode may be a directional predictionmode in which reference pixel information is used according to aprediction direction and a non-directional mode in which directionalinformation is not used in performing prediction. A prediction mode forluma information and a prediction mode for chroma information may bedifferent, and in order to predict chroma information, intra-predictionmode information for luma information and predicted luma signalinformation may be utilized.

In performing intra-prediction, when a size of a prediction unit (PU)and a size of a transform unit (TU) are equal, intra-prediction for aprediction unit (PU) is performed on based on pixels located on the leftof the prediction unit (PU), pixels located on left-upper of theprediction unit (PU), and pixels located on upper of the prediction unit(PU) However, in performing intra-prediction, when a size of aprediction unit (PU) and a size of a transform unit (TU) are different,intra-prediction may be performed by using a reference pixel based onthe transform unit (TU). Also, intra-prediction using N×N partition maybe used only on a minimum CU.

In the intra-prediction method, after an adaptive intra-smoothing (AIS)filter may be applied to a reference pixel according to a predictionmode, a prediction block may be generated. Types of AIS filter appliedto the reference pixel may vary. In order to perform theintra-prediction method, an intra-prediction mode of a current PU may bepredicted using an intra-prediction mode of a PU neighboring the currentprediction unit. When a prediction mode of the current PU is predictedby using mode information for a neighbor PU, if intra-prediction modesof the current PU and the prediction modes of the neighbor PU areidentical, information indicating that the prediction modes of thecurrent PU and the neighbor PU are identical may be transmitted by usingpredetermined flag information. And if the prediction modes of thecurrent PU and the prediction modes of the neighbor PU are different,entropy encoding may be performed to encode prediction mode informationof a current block.

The prediction unit may derive intra-prediction mode information of thecurrent PU by using a predetermined binary code based on theintra-coding mode encoding method according to an embodiment of thepresent invention described with reference to FIGS. 3 through 8hereinafter.

Also, a residual block including residual information as a differencevalue between a PU generated by the prediction module 110 and theoriginal block corresponding to the PU may be generated. The generatedresidual block may be input to the transform module 115. The transformmodule 115 may transform the residual block including the residual valueinformation based on the original block and the PU generated by theprediction module 110 using a transform method such as discrete cosinetransform (DCT) or discrete sine transform (DST). Whether to apply DCTor DST to transform the residual block may be determined based onintra-prediction mode information of the PU.

The quantization module 120 may quantize values which have beentransformed into a frequency domain by the transform module 115. Aquantization coefficient may vary according to a block or importance ofa picture. A value output from the quantization module 120 may beprovided to the dequantization module 135 and the rearrangement module125.

The rearrangement module 125 may rearrange the quantized residual value.

The rearrangement module 125 may change coefficients of atwo-dimensional (2D) block type into a one-dimensional (1D) vectorthrough a coefficient scanning method. For example, the rearrangementmodule 125 may scan from a DC coefficient up to a coefficient of a highfrequency domain by using a zigzag scan method to change them into a 1Dvector form. According to a size of a TU and an intra-prediction mode, avertical scan method which scans 2D block type coefficients in a columndirection or a horizontal scan method which scan 2D block typecoefficients in a row direction, rather than the zigzag scan method, maybe used. Namely, which one of the zigzag scan method, the vertical scanmethod, and the horizontal scan method may be determined according to asize of a TU and an intra-prediction mode.

The entropy encoding module 130 may perform entropy encoding based onthe values output from the rearrangement module 125. For example,various encoding methods such as exponential Golomb, context-adaptivevariable length coding (CAVLC), and context-adaptive binary arithmeticcoding (CABAC) may be used as entropy encoding.

The entropy encoding module 130 may encode a plurality of informationsuch as residual value coefficient information of a CU and block typeinformation, prediction mode information, partition unit information, PUinformation and transmission unit information, motion vectorinformation, reference picture information, block interpolationinformation, filtering information, and the like, from the rearrangementmodule 125 and the prediction module 110.

The entropy encoding module 130 may entropy-encode a coefficient valueof a CU input from the rearrangement module 125.

The entropy encoding module 130 may store a table for performing entropycoding such as a variable length coding table, and perform entropycoding by sing the stored variable length coding table. In performingentropy coding, a codeword allocation with respect to a code number ofcorresponding information may be changed by using a method using acounter on a partial codeword included in a table or a direct swappingmethod. For example, in case of some higher code numbers to which asmaller number of bits are allocated in a table in which code numbersand codewords are mapped, a mapping order of the table in whichcodewords and code numbers are mapped may be adaptively changed suchthat a short codeword is allocated to a code number having the largestnumber of times of adding up code numbers by using a counter. When thenumber counted by the counter reaches a predetermined threshold value,the counted number recorded in the counter may be halved and countingmay be performed again.

In case of a code number in the table which has not been counted, wheninformation corresponding to the code number is generated by the directswapping method, it is swapped with an immediately above code number toreduce the number of bits allocated to the corresponding code number tothus perform entropy coding.

The entropy coding module may express intra-prediction mode informationof a current PU by using a predetermined binary code based on theintra-coding mode encoding method according to the embodiment of thepresent invention described with reference to FIGS. 3 through 8.

The dequantization module 135 and the inverse-transform module 140 maydequantize the values quantized by the quantization module 120 andinverse-transforms values transformed by the transform module 115.Residual values generated by the dequantization module 135 and theinverse-transform module 140 may be added with the PU predicted throughthe motion estimation module, the motion compensation module, and theintra-prediction module included in the prediction module to generate areconstructed block.

The filter module 145 may include at least one of a deblocking filter,an offset compensation module, and an adaptive loop filter (ALF).

The deblocking filter 145 may remove block distortion generated due to aboundary between blocks in the reconstructed picture. Whether to apply adeblocking filter to a current block may be determined based on pixelsincluded in some columns and rows included in a block. When thedeblocking filter is applied to the block, a strong filter or a weakfilter may be selected according to strength of required deblockingfiltering. Also, in applying the deblocking filter, when verticalfiltering and horizontal filtering are performed, horizontal directionalfiltering and vertical directional filtering may be processed inparallel.

The offset compensation module may compensate for an offset with anoriginal picture with respect to a deblocked image by a pixel. In orderto perform offset compensation on a picture, a method of partitioningpixels included in the picture into a predetermined number of regions,determining a region in which offset is to be performed, and applyingoffset to the corresponding region, or a method of applying offset inconsideration of edge information of each pixel may be used.

The ALF (Adaptive Loop Filter) may perform filtering based on a valueobtained by comparing the filtered reconstructed image and the originalimage. Pixels included in an image may be divided into a predeterminedgroup, a filter to be applied to a corresponding group may be determinedto differentially filtering each group. Information regarding whether toapply the ALF may be transmitted by coding unit (CU), and a size and acoefficient of the ALF to be applied may be vary according to eachblock. The ALF may have various shapes, and the number of coefficientsincluded in the filter may also vary. Filtering-related information(filter coefficient information, ALF ON/OFF information, filter shapeinformation) of the ALF may be included in a predetermined parameter setin a bit stream and transmitted.

The memory 150 may store a reconstructed block or picture output fromthe filter module 145, and the stored reconstruction block or picturemay be provided to the prediction module 110 when inter-prediction isperformed.

FIG. 2 is a block diagram illustrating a video decoder according toanother embodiment of the present invention.

Referring to FIG. 2, a video decoder 200 may include an entropy decodingmodule 210, a rearrangement module 215, a dequantization module 220, aninverse-transform module 225, a prediction module 230, a filter module235, and a memory 240.

When a video bit stream is input to the video encoder, the input bitstream may be decoded in a procedure opposite to that of the videoencoder.

The entropy decoding module 210 may perform entropy decoding in aprocedure opposite to that of the entropy coding by the entropy codingmodule of the video coder. For example, a VLC table used to performentropy coding may be implemented as the same variable length codingtable also in the entropy decoding unit to perform entropy encoding.Information for generating a prediction block, among the informationdecoded by the entropy decoding module 210 may be provided to theprediction module 230, and the residual value obtained after performingthe entropy decoding by the entropy decoding module may be input to therearrangement module 215.

Like the entropy encoding module, the entropy decoding module 210 maychange a codeword allocation table by using a counter or a directswapping method, and perform entropy decoding based on the changedcodeword allocation table.

The entropy decoding module 210 may decode information related tointra-prediction and inter-prediction performed by the encoder. Asdescribed above, in a case in which there is certain restriction whenintra-prediction and inter-prediction is performed by the video encoder,entropy decoding may be performed based on such restriction to receiveinformation related to intra-prediction and inter-prediction withrespect to a current block. The entropy decoding module may perform adecoding operation as described with reference to FIGS. 3 through 8.

The entropy decoding module 210 may decode intra-prediction modeinformation of a current PU by using a predetermined binary code basedon the intra-coding mode decoding method according to the embodiment ofthe present invention described with reference to FIGS. 3 through 8.

The rearrangement module 215 may rearrange r an entropy-decoded bitstream by the entropy decoding module 210 based on the method ofrearrangement in the encoding module. Coefficients in the form of a 1Dvector may be reconstructed into coefficients in the form of a 2D blockand rearranged. The rearrangement module 215 may be provided withinformation related to coefficient scanning performed in the encodingmodule, and perform rearrangement through a method of reversely scanningbased on the scanning order performed in the corresponding the encodingmodule.

The dequantization module 220 may perform dequantization based on aquantization parameter provided from the encoder and the rearrangedcoefficient value of the block.

The inverse-transform module 225 may perform inverse-DCT and inverse-DSTcorresponding to the DCT and the DST performed by the transform moduleon the quantization results performed by the video encoder. Theinverse-transform may be performed based on a transmit unit determinedby the video encoder. The transform module 115 of the video encoder mayselectively perform DCT and DST according to a plurality of informationsuch as a prediction method, a size of a current block, a predictiondirection, and the like. The dequantization module 225 of the videodecoder may perform inverse transform based on the informationtransformed by the transform module of the video encoder.

When the transform is performed, the transform may be performed based oncoding unit (CU), rather than the transform unit (TU).

The prediction module 230 may generate a prediction block based on theprediction block generation-related information provided from theentropy decoding module 210 and the previously decoded block or pictureinformation provided from the memory 240.

As described above, like the operation in the video encoder, inperforming intra-prediction, when a size of a prediction unit (PU) and asize of a transform unit (TU) are equal, intra-prediction for aprediction unit (PU) is performed on based on pixels located on the leftof the prediction unit (PU), pixels located on left-upper of theprediction unit (PU), and pixels located on upper of the prediction unit(PU) However, in performing intra-prediction, when a size of aprediction unit (PU) and a size of a transform unit (TU) are different,intra-prediction may be performed by using a reference pixel based onthe transform unit (TU). Also, intra-prediction using N×N partition maybe used only on a minimum coding unit.

The prediction module 230 may include a prediction unit (PU)discriminating module, an inter-prediction module, and anintra-prediction module. The PU discriminating module may receivevarious information such as PU information input from the entropydecoding module, prediction mode information of an intra-predictionmethod, a motion prediction-related information of an inter-predictionmethod, and the like, input from the entropy decoding module,discriminate PU from a current CU, and discriminate whether a PU is toperform inter-prediction or infra-prediction. The inter-predictionmodule may perform inter-prediction on a current PU based on informationincluded in at least one picture among a previous picture and asubsequent picture of a current picture including a current PU by usinginformation required for inter-prediction of the current PU providedfrom the video encoder.

In order to perform inter-prediction, based on CU, which one of a skipmode, a merge mode, and an AMVP mode corresponds to a motion predictionmethod of a PU included in the corresponding CU may be determined.

The intra-prediction module may generate a prediction block based onpixel information of the current picture. When intra-prediction may beperformed on a PU, intra-prediction may be performed based onintra-prediction mode information of the PU provided from the videoencoder. The intra-prediction module may include an AIS filter, areference pixel interpolation unit, and a DC filter. The AIS filter is apart performing filtering on a reference pixel of a current block, andwhether to apply the filter may be determined according to a predictionmode of a current PU and applied. AIS filtering may be performed on thereference pixel of the current block by using the prediction mode of thePU and the AIS filter information provided from the video encoder. In acase in which the prediction mode of the current block is a mode inwhich AIS filtering is not performed, the AIS filter may not be applied.

When the intra-prediction may perform based on a pixel value obtained byinterpolating the reference pixel, the reference pixel interpolationmodule may interpolate the reference pixel to generate a reference pixelbelow an integer value. When the prediction mode of the current PU is aprediction mode in which a prediction block is generated withoutinterpolating the reference pixel, the reference pixel may not beinterpolated. In a case in which the prediction mode of the currentblock is a DC mode, the DC filter may generate a prediction blockthrough filtering.

The reconstructed block or picture may be provided to the filter module235. The filter module 235 may include a deblocking filter, an offsetcompensation unit, and an ALF.

Information regarding whether a deblocking filter has been applied tothe corresponding block or picture and information regarding whether astrong filter or a weak filter has been applied if the deblocking filterhas been applied may be received from the video encoder. The deblockingfilter of the video decoder may receive deblocking filter-relatedinformation provided form the video encoder and the video decoder mayperform deblocking filtering on the corresponding block. Like in thevideo encoder, first, vertical deblocking filtering and horizontaldeblocking filtering may be performed, and at least one of verticaldeblocking and horizontal deblocking may be performed in an overlapportion. Vertical deblocking filtering or horizontal deblockingfiltering which has not been performed previously may be performed in aportion in which vertical deblocking filter and horizontal deblockingfiltering overlap. Through the deblocking filtering process, parallelprocessing of the deblocking filtering may be performed.

The offset compensation unit may perform offset compensation on thereconstructed image based on a type of offset compensation applied tothe image during encoding, offset value information, and the like.

The ALF may perform filtering based on a value obtained by comparing theimage reconstructed after filtering and the original image. Based oninformation whether ALF has been applied, ALF coefficient information,and the like, provided from the encoder, ALF may be applied to a CU.Such ALF information may be included in a specific parameter set andprovided.

The memory 240 may store the reconstructed picture or block so as to beused as a reference picture or reference block, and or provide thereconstructed picture to the output module.

As described above, in the embodiment of the present invention, a codingunit (CU) is used as a term of encoding unit, but it may also be a unitof performing decoding as well as encoding. Hereinafter, anintra-prediction mode encoding/decoding method using two candidateintra-prediction modes according to an embodiment of the presentinvention described with reference to FIGS. 3 through 8 may beimplemented according to functions of each mode described above withreference to FIGS. 1 and 2 and such encoder and decoder may fall withincoverage of the present invention.

FIG. 3 is a conceptual view illustrating a method for encoding anintra-prediction mode of a current prediction unit (PU) according toanother embodiment of the present invention.

Referring to FIG. 3, an intra-prediction mode of a current PU may bederived based on an intra-prediction mode of a neighbor PU of thecurrent PU.

Hereinafter, in the embodiment of the present invention, a PU used forderiving an intra-prediction mode of a current PU 300 will be referredto a neighbor PU. When location of a left upper pixel of the current PUis (x, y), the neighbor PU may be a first neighbor PU 310 including apixel value positioned in (x−1, y) and a second neighbor PU 320including a pixel value positioned in (x, y−1).

To predict the intra-prediction mode of the current PU 300, when it isdetermined whether the intra-prediction mode of the current PU 300 andintra-prediction mode of a neighbor PU or to an intra-prediction modeused as a candidate mode of the intra-prediction mode of the current PU300 in a predetermined order (hereinafter, referred to as “sequentialinter-prediction mode”) is identical. The intra-prediction mode of theneighbor PU are not available when a neighbor PU does not exist or aninter-prediction mode is used. When they are identical, a predeterminedflag information indicating that the intra-prediction mode of thecurrent PU and the intra-prediction mode of a neighbor PU or thesequential inter-prediction mode are identical may encoded.

Hereinafter, in the embodiment of the present invention, in order topredict intra-prediction mode of the current PU, two intra-predictionmodes among intra-prediction mode of a neighbor PU and the sequentialintra-prediction mode are used as prediction candidates, and theintra-prediction modes used as prediction candidates will be referred toas a first candidate intra-prediction mode and a second candidateintra-prediction mode.

When a first neighbor PU 310 and a second neighbor PU 320 of the currentPU 300 exist intra-prediction is applied to the first neighbor PU 310and the second neighbor PU 320, and intra-prediction mode values of thefirst neighbor PU 310 and the second neighbor PU 320 are different, anintra-prediction mode having a smaller value among intra-prediction modevalues of the first neighbor PU 310 and the second neighbor PU 320 maybe set as a first candidate intra-prediction mode and anintra-prediction mode having a larger value among the intra-predictionmode values of the first neighbor PU 310 and the second neighbor PU 320may be set as a second candidate intra-prediction mode. Alternatively,an intra-prediction mode of the first neighbor PU may be set as a firstcandidate inter-prediction mode, and the intra-prediction mode of thesecond neighbor PU may be set as a second candidate intra-predictionmode.

Hereinafter, when a exists and the intra-prediction is used to predict aprediction mode of the neighbor PU performs, the neighbor PU is calledan available neighbor PU.

When both the first neighbor PU 310 and the second neighbor PU 320 ofthe current PU 300 exist and intra-prediction is applied to the firstneighbor PU 310 and the second neighbor PU 320 so both the firstneighbor PU 310 and the second neighbor PU 320 are available neighborPUs but intra-prediction mode values of the neighbor PUs are identical,the intra-prediction mode value of the neighbor PU may be used as afirst candidate intra-prediction mode value and one of a planar mode anda DC mode may be sequentially set as a second candidate intra-predictionmode value and used. When the first candidate intra-prediction modevalue is the same as the second candidate intra-prediction mode, ratherthan the planar mode, the second candidate intra-prediction mode valuemay be set as a planar mode. When the first candidate intra-predictionmode value is the planar mode, the second candidate intra-predictionmode may be set as a DC mode.

In a similar manner, When only one of the first neighbor PU 310 and thesecond neighbor PU 320 is an available neighbor PU, an intra-predictionmode value of available neighbor PU may be used as a first candidateintra-prediction mode value and one of the planar mode and the DC modemay be used as a second candidate intra-prediction mode value. When thefirst candidate intra-prediction mode value is not the planar mode, thesecond candidate intra-prediction mode may be set as the planar mode.When the first candidate intra-prediction mode is the planar mode, thesecond candidate intra-prediction mode may be set as the DC mode.

When both the first neighbor PU 310 and the second neighbor PU 320 ofthe current PU 300 are not available, the first candidateintra-prediction mode value may be set as the planar mode and the secondcandidate intra-prediction mode value may be set as the DC mode.

Namely, in the intra-prediction mode encoding/decoding method usingintra-prediction modes of two neighbor blocks according to theembodiment of the present invention, when at least one of the candidateintra-prediction modes is not available, the planar mode or the DC modeis sequentially used as the unavailable candidate intra-prediction mode,whereby both the first candidate intra-prediction mode and the secondcandidate intra-prediction mode are used as candidate intra-predictionmodes.

FIG. 4 is a conceptual view illustrating a method of determiningavailability of neighbor prediction units according to anotherembodiment of the present invention.

Referring to FIG. 4, it is determined whether a first neighbor PU isavailable (S400).

When a first neighbor PU exists on the left of a current PU andprediction has been performed based on an intra-prediction mode, it isdetermined that the first neighbor PU is available.

When the first neighbor PU is not available, a value of anintra-prediction mode of the first neighbor PU is set to −1 (S410).

‘−1’ is a variable indicating that the first neighbor PU is notavailable, and availability of the first neighbor PU may also bedetermined through a different variable.

The mode value of the first neighbor PU may be specified based on apredetermined syntax element. The mode vale of the firstintra-prediction mode may be specified as a syntax elementneg_intra_mode[0], and when the value of neg_infra_mode[0] is −1, it maybe indicate that the first neighbor PU is not available.

When the first neighbor PU is available, an intra-prediction mode valueof the first neighbor PU is used as a first candidate intra-predictionmode (S420).

The intra-prediction mode information of the first neighbor PU may bespecified as a syntax element neg_intra_mode[0], and theintra-prediction mode value of the first neighbor PU may be stored inthe syntax element neg_intra_mode[0] indicating the first candidateintra-prediction mode.

The value of the intra-prediction mode may be expressed as shown inTable 1 below.

Table 1 represents in which intra-prediction modes and numberscorresponding to the intra-prediction modes (hereinafter, referred to asan ‘intra-prediction mode number’) are mapped

TABLE 1 Intra prediction mode Associated names 0 Intra_Planar 1Intra_Vertical 2 Intra_Horizontal 3 Intra_DC Otherwise (4 . . . 34)Intra_Angular

Referring to Table 1, the planar mode (Intra Planar) may be allocated toan intra-prediction number 0, a vertical mode (Intra_Vertical) may beallocated to 1, a horizontal mode (Intra_Horizontal) may be allocated to2, a DC mode (Intra_DC) may be allocated to 3, and other directionalmodes (Intra_Angular) may be allocated to 4 to 34.

In the method of mapping the intra-prediction modes and theintra-prediction mode numbers according to the embodiment of the presentinvention, the smallest intra-prediction mode number is mapped to theplaner mode, and the intra-prediction modes are mapped to the codenumbers in order of the vertical mode, the horizontal mode, and the DCmode, whereby the intra-prediction numbers are mapped to small codenumbers according to order of frequency of intra-prediction mode. As aresult, when binary coding is performed to transmit intra-predictionmode information, the intra-prediction mode information of a PU may beexpressed with a smaller number of bits.

It is determined whether a second neighbor PU is available (S430).

When a second neighbor PU of the left of a current PU exists andprediction is performed based on intra-prediction mode, it is determinedthat the second neighbor PU is available.

In a case in which the second neighbor PU is not available, a value ofthe intra-prediction mode of the second neighbor PU is set to −1 (S440).

‘31 1’ is a variable indicating that the second neighbor PU is notavailable, and availability of the second neighbor PU may also bedetermined through a different variable.

The mode value of the second neighbor PU may be specified based on apredetermined syntax element. The mode vale of the secondintra-prediction mode may be specified as a syntax elementneg_intra_mode[1], and when the value of neg_intra_mode[1] is −1, it maybe indicate that the second neighbor PU is not available.

When the second neighbor PU is available, an intra-prediction mode valueof the second neighbor PU is used as a second candidate intra-predictionmode (S450).

The intra-prediction mode information of the second neighbor PU may bespecified as a syntax element neg_infra_mode[1], and theintra-prediction mode value of the second neighbor PU may be stored inthe syntax element neg_infra_mode[1] indicating the second candidateintra-prediction mode.

Hereinafter, a predetermined syntax element in the embodiment of thepresent invention may be defined by a different variable or may becombined with different syntax element information so as to be expressedas long as it is not departed from the essence of the present invention.Also, values of mode information allocated to syntax elements arearbitrary and the same information may be expressed by different values.

Table 2 represents the number of intra-prediction mode that may existaccording to sizes of PU.

TABLE 2 log2TrafoSize intraPredModeNum 2 (4 × 4) 18 3 (8 × 8) 35 4 (16 ×16) 35 5 (32 × 32) 35 6 (64 × 64) 4

Referring to Table 2, when a size of transform unit (TU) is 4×4, 18intra-prediction modes from 0 to 17 are used as mapped in Table 1, andwhen sizes of TU are 8×8, 16×16, and 32×32, 35 intra-prediction modesfrom 0 to 34 are used, and when a size of TU is 64×64, fourintra-prediction modes from 0 to 3 are used.

In the intra-prediction mode encoding/decoding method usingintra-prediction modes of two neighbor blocks, sizes of a current PU anda neighbor PU for predicting an intra-prediction mode of the current PUmay be different.

Thus, when available prediction mode values are different in the currentPU and the neighbor PU, a first candidate intra-prediction mode valueand a second candidate intra-prediction mode value of a neighbor PUshould be changed based on a prediction mode available in the current PUin order to obtain the first candidate intra-prediction mode value andthe second candidate intra-prediction mode value.

FIG. 5 is a flow chart illustrating a method of changing anintra-prediction mode of a neighbor prediction unit based on a currentPU according to another embodiment of the present invention.

Referring to FIG. 5, it is determined whether a value of a candidateintra-prediction mode is greater than or equal to the number ofavailable intra-prediction modes of the current PU (S500).

By determining whether the intra-prediction mode value of the firstneighbor PU or the intra-prediction mode value of the second neighbor PUis greater than or equal to the number of available intra-predictionmode modes of the current PU, whether to change the intra-predictionmode value of the first neighbor PU or the intra-prediction mode of thesecond neighbor PU may be determined.

A syntax element neg_infra_mode[i] may be an intra-prediction mode valueof a neighbor PU and a syntax element intra_pred_mode_num may be thenumber of intra-prediction modes available in the current PU.

When an intra-prediction mode value of the first neighbor PU or theintra-prediction mode value of the second neighbor PU is greater than orequal to the number of available intra-prediction modes of the currentPU, it is determined whether the number of available intra-predictionmodes of the current PU is 4 (S510).

By determining the number of available intra-prediction modes of thecurrent PU, an intra-prediction mode value of the first neighbor PU orthe intra-prediction mode value of the second neighbor PU may be changedaccording to the available intra-prediction mode of the current PU.

In step S510, whether the number of available intra-prediction modes ofthe current PU is 4 is determined for the description purpose, andwhether the number of available intra-prediction modes of the current PUis 18 may be determined and a follow-up procedure may be performed.

When the number of available intra-prediction modes of the current PU is4, an intra-prediction mode value of the first neighbor PU or anintra-prediction mode value of the second neighbor PU may be changedbased on a predetermined mapping table in which an availableintra-prediction mode of a current PU and an intra-prediction mode valueof a first neighbor PU or an intra-prediction mode value of a secondneighbor PU.

Table 3 and Table 4 below are intra-prediction mode mapping tablesaccording to an embodiment of the present invention.

TABLE 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 mapIntraPredMode4[ ]0 1 2 3 0 0 1 0 2 2 0 0 1 1 0 0 2 2 mapIntraPredMode10[ ] 0 1 2 3 4 5 67 8 9 0 0 0 0 0 0 0 0 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34mapIntraPredMode4[ ] 0 0 0 0 1 1 1 0 0 0 0 2 2 2 2 0 0mapIntraPredMode10[ ] 0 4 5 5 1 1 6 6 7 4 8 8 2 2 9 9 0

TABLE 4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 mapIntraPredMode4[ ]0 1 2 3 3 3 1 3 2 2 3 3 1 1 3 3 2 2 mapIntraPredMode10[ ] 0 1 2 3 4 5 67 8 9 3 3 3 3 3 3 3 3 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34mapIntraPredMode4[ ] 3 3 3 3 1 1 1 3 3 3 3 2 2 2 2 3 3mapIntraPredMode10[ ] 3 4 5 5 1 1 6 6 7 4 8 8 2 2 9 9 3

Referring to Table 3 and Table 4, in a case in which the number ofavailable prediction modes of a current PU is 4, an intra-predictionmode value of a neighbor PU may be mapped to an available predictionmode of the current PU based on a value of the intra-prediction modederived by a syntax element mapIntraPredMode4[ ]. Also, in a case inwhich the number of available prediction modes of a current PU is 18, anintra-prediction mode value of a neighbor PU may be mapped to anavailable prediction mode of the current PU based on a value of theintra-prediction mode derived by a syntax element mapIntraPredMode10[ ].

The intra-prediction mode mapping table of Table 3 is a mapping tablegenerated such that many intra-prediction mode values are mapped to mode0 (planar mode) and the intra-prediction mode mapping table of Table 4is a mapping table generated such that many intra-prediction mode valuesare mapped to mode 3 (DC mode). Namely when Table 3 is used as anintra-prediction mode table, an intra-prediction mode value of the firstneighbor PU or an intra-prediction mode value of the second neighbor PUis mapped to the planar mode much more than other modes, and when Table4 is used as an intra-prediction mode table, an intra-prediction modevalues of the first neighbor PU or an intra-prediction mode values ofthe second neighbor PU is mapped to the DC mode much more than othermodes.

Based on the intra-prediction mode mapping table, the intra-predictionmode value of the first neighbor PU or the intra-prediction mode valueof the second neighbor PU is changed to at least one of four predictionmodes (S520).

Based on the intra-prediction mode mapping table, the intra-predictionmode value of the first neighbor PU or the intra-prediction mode valueof the second neighbor PU is changed to at least one of ten predictionmodes (S530).

In steps S520 and S530, based on the predetermined intra-predictionmapping table described in Table 3 or Table 4, the intra-prediction modevalue of the neighbor PU may be mapped to at least one ofintra-prediction modes of the available current PU.

probMode[i] may be used as a syntax element representing anintra-prediction mode value of the first neighbor PU or anintra-prediction mode value of the second neighbor PU.

When the intra-prediction mode value of the first neighbor PU or theintra-prediction mode intra-prediction mode value of the second neighborPU is smaller than the number of available intra-prediction modes of thecurrent PU, the intra-prediction mode value of the first neighbor PU orthe intra-prediction mode value of the second neighbor PU is used asinformation for predicting an intra-prediction mode value of the currentPU as it is (S540).

When the intra-prediction mode value of the first neighbor PU or theintra-prediction mode intra-prediction mode value of the second neighborPU is smaller than the number of available intra-prediction modes of thecurrent PU, the intra-prediction mode value of the first neighbor PU orthe intra-prediction mode value of the second neighbor PU may be used asit is, without being changed.

FIG. 6 is a flow chart illustrating a method of generating a firstcandidate intra prediction mode and a second intra prediction modeaccording to another embodiment of the present invention.

Referring to FIG. 6, it is determined whether the intra-prediction modevalue of the first neighbor PU and the intra-prediction mode value ofthe second neighbor PU are available (S600).

Based on the number of intra-prediction modes used in the current PUbased on the procedure described above with reference to FIG. 5, whetherthe intra-prediction mode value of the first neighbor PU or theintra-prediction mode value of the second neighbor PU reset by using theintra-prediction mode mapping table is used as a first candidateintra-prediction mode value or a second candidate intra-prediction modevalue based on neighbor PU of the current PU may be determined.

Namely, in step S600, whether the intra-prediction mode value of thefirst neighbor PU or the intra-prediction mode value of the secondneighbor PU is available to be used as a first candidateintra-prediction mode or a second candidate intra-prediction mode. Whenat least one of the first candidate intra-prediction mode and the secondcandidate intra-prediction mode is not derived from the neighbor PU, oneof sequential intra-prediction modes may be used as the first candidateintra-prediction mode or the second candidate intra-prediction mode.

It is determined whether the first intra-prediction mode value of thefirst neighbor PU and the intra-prediction mode value of the secondneighbor PU are identical (S610).

When the first intra-prediction mode value of the first neighbor PU andthe intra-prediction mode value of the second neighbor PU are notidentical, it is determined whether the intra-prediction mode value ofthe first neighbor PU is greater than the intra-prediction mode value ofthe second neighbor PU (S613).

When the intra-prediction mode value of the first neighbor PU is greaterthan the intra-prediction mode value of the second neighbor PU, theintra-prediction mode value of the second neighbor PU is set as thefirst candidate intra-prediction mode, and the intra-prediction modevalue of the first neighbor PU is set as the second candidateintra-prediction mode (S615).

When the intra-prediction mode value of the first neighbor PU is smallerthan the intra-prediction mode value of the second neighbor PU, theintra-prediction mode value of the first neighbor PU is set as the firstcandidate intra-prediction mode, and the intra-prediction mode value ofthe second neighbor PU is set as the second candidate intra-predictionmode (S617).

A syntax element candMPM[0] indicates the first candidateintra-prediction mode and a syntax element candMPM[1] indicates thesecond candidate intra-prediction mode.

When the intra-prediction mode value of the first neighbor PU or theintra-prediction mode value of the second neighbor PU are identical, theintra-prediction mode value of the first neighbor PU or theintra-prediction mode value of the second neighbor PU is set as a firstcandidate intra-prediction mode (S630) and it is determined whether thefirst candidate intra-prediction mode is a planar mode (S640).

As described above, when only one of the first candidateintra-prediction mode and the second candidate intra-prediction modeexists, the planar mode or the DC mode may be used one of the firstcandidate intra-prediction mode and the second candidateintra-prediction mode by using the sequential intra-prediction mode.

In the intra-prediction mode allocating method according to theembodiment of the present invention, since two differentintra-prediction modes are used as the first candidate intra-predictionmode and the second candidate intra-prediction mode, when the firstcandidate intra-prediction mode is not the planar mode, the secondcandidate intra-prediction mode is set as the planar mode (S650), andwhen the first candidate intra-prediction mode is a planar mode, the DCmode may be set as the second candidate intra-prediction mode and used(S660).

It is determined whether only the intra-prediction mode value of thefirst neighbor PU is available (S670).

When only the intra-prediction mode value of the first neighbor PU isavailable, the intra-prediction mode value of the first neighbor PU isset as the first candidate intra-prediction mode value (S680).

It is determined whether only the intra-prediction mode value of thesecond neighbor PU is available (S690).

When only the intra-prediction mode value of the second neighbor PU isavailable, the intra-prediction mode value of the second neighbor PU isset as the second candidate intra-prediction mode value (S693).

When only one of the two neighbor PUs is available in S670 to S693, anintra-prediction mode value of the available PU may be set as the firstcandidate intra-prediction mode.

When only one of the two neighbor PUs is available, the second candidateintra-prediction mode may be determined based on the procedure describedabove in steps S640 to S660.

When neither of the two neighbor PUs are available, the planar mode maybe set as the first candidate intra-prediction mode and the DC mode maybe set as the second candidate intra-prediction mode (S696).

When neither of the two neighbor PUs are available, the planar mode maybe set as the first candidate intra-prediction mode and the DC mode maybe set as the second candidate intra-prediction mode by using thesequential intra-prediction mode.

FIG. 7 is a flow chart illustrating a method of mapping information of acurrent prediction mode to codeword according to another embodiment ofthe present invention.

Referring to FIG. 7, it is determined whether an intra-prediction modeof a current PU and a first candidate intra-prediction mode or a secondintra-prediction mode are identical (S700).

When the intra-prediction mode of the current PU and the first candidateintra-prediction mode or the second intra-prediction mode are identical,1 is allocated as codeword information (S710). When the intra-predictionmode of the current PU and the first candidate intra-prediction mode orthe second intra-prediction mode are not identical, 0 is allocated ascodeword information (S720).

It is determined whether the intra-prediction mode of the current PU andthe first candidate intra-prediction mode are identical (S730). When theintra-prediction mode of the current PU and the first candidateintra-prediction mode are identical, 0 is additionally allocated ascodeword information (S740), and when the intra-prediction mode of thecurrent PU and the first candidate intra-prediction mode are different,1 is additionally allocated as codeword information (S750).

When the intra-prediction mode of the current PU and the first candidateintra-prediction mode are identical or the second candidateintra-prediction mode are not identical so 0 is allocated as codewordinformation, rem_intra_pred_mode (hereinafter, it is used as a termhaving the same meaning for the other remaining intra-prediction modes)in which the other remaining intra-prediction mode information is mappedto codewords is additionally allocated to a codeword in order to expressintra-prediction mode information of the current PU (S760).

Table 5 represents mapping between intra-prediction modes of current PUand codewords.

TABLE 5 Current mode Code words (intra_pred_mode) 10 candMPM[0] 11candMPM[1] 0 + rem rem_intra_pred_mode

Referring to Table 5, when the intra-prediction mode of the current PUand the first candidate intra-prediction mode or the second candidateintra-prediction mode is identical, a prediction mode of the current PUmay be known with 2-bit codeword, and when the intra-prediction mode ofthe current PU and the first candidate intra-prediction mode or thesecond candidate intra-prediction mode is not identical, anintra-prediction mode of the current PU may be known based on a bitvalue allocated to rem_intra_pred_mode by 1 bit.

Codewords allocated to rem_intra_pred_mode as a remainingintra-prediction mode may be changed. to change the remainingintra-prediction mode, a mode value of a prediction mode of a current PUand the first candidate intra-prediction mode value and the secondcandidate intra-prediction mode are compared, and any one of the firstcandidate intra-prediction mode value and the second candidateintra-prediction mode which has a value smaller than the prediction modeof the current PU is exclusive from the current mapping table, wherebythe codeword of the intra-prediction mode allocated to the currentremaining intra-prediction mode may be mapped short.

In the intra-prediction mode information determining method according tothe embodiment of the present invention, in case of using a transformunit (TU) having a size of 64×64, types of intra-prediction mode of acurrent PU and codewords may be mapped as shown in Table 6.

TABLE 6 Current mode Code words (intra_pred_mode) 00 Planar 01 Ver 10Hor 11 DC

Referring to Table 6, when the TU having the size of 64×64 is used, fourtypes of intra-prediction mode are available, and thus, intra-predictionmode information of the current PU may be expressed by fixed 2 bitswithout a process of determining whether an intra-prediction mode of thecurrent PU and a first candidate intra-prediction mode and a secondcandidate intra-prediction mode are identical.

FIG. 8 is a flow chart illustrating a method of decoding a currentintra-prediction mode according to another embodiment of the presentinvention.

Referring to FIG. 8, it is determined whether an intra-prediction modeof a current PU is identical to a first candidate intra-prediction modeor a second candidate intra-prediction mode (S800).

In order to determine whether the intra-prediction mode of the currentPU is identical to the first candidate intra-prediction mode or thesecond candidate intra-prediction mode, predetermined flag informationprev_intra_pred_flag indicating whether the intra-prediction mode of thecurrent PU is identical to the first candidate intra-prediction mode orthe second candidate intra-prediction mode may be used. Whenprev_intra_pred_flag is 1, it indicates that the intra-prediction modeof the current PU is identical to the first candidate intra-predictionmode or the second candidate intra-prediction mode, and whenprev_intra_pred_flag is 0, it indicates that the intra-prediction modeof the current PU is not identical to the first candidateintra-prediction mode or the second candidate intra-prediction mode.

When prev_intra_pred_flag is 1, intra-prediction mode information of thecurrent PU may be set by using mpm_idx indicating which the firstcandidate intra-prediction mode or the second candidate intra-predictionmode is identical to the intra-prediction mode of the current PU.

When mpm_idx is determined to be 0 (S810), the intra-prediction mode ofthe current PU may be determined as the first candidate intra-predictionmode (S820), and when mpm_idx is determined to be 1, theintra-prediction mode of the current PU may be determined as the secondcandidate intra-prediction mode (S830)

When prev_intra_pred_flag is 0, intra-prediction mode information of thecurrent PU may be decoded based on rem_intra_pred_mode indicatingremaining intra-prediction mode information (S840).

Namely, the decoder may receive the codeword value described in Table 4,and decode intra-prediction mode information of the current PU allocatedto the corresponding codeword.

A codeword allocated to rem_intra_pred_mode is changed (S850).

Like in the encoder as described above, the decoder may allocate a newcodeword to a remaining intra-prediction mode value. A mode value of aprediction mode of the current PU and the first candidateintra-prediction mode value and the second candidate intra-predictionmode are compared, and any one of the first candidate intra-predictionmode value and the second candidate intra-prediction mode which has avalue smaller than the prediction mode of the current PU is exclusivefrom the current mapping table, and the codeword may be newly allocatedfrom the new current mapping table excluded any one of the firstcandidate intra-prediction mode value and the second candidateintra-prediction mode.

In the intra-prediction mode information determining method according tothe embodiment of the present invention, when the transform unit (TU)having the size of 64×64 as described above is used, if types of theintra-prediction modes of the current PU and codewords are mapped with5, intra-prediction mode information of the current PU may be expressedby fixed 2 bits without a process of determining whether anintra-prediction mode of the current PU and a first candidateintra-prediction mode and a second candidate intra-prediction mode areidentical.

While embodiments have been shown and described above, it will beapparent to those skilled in the art that modifications and variationscould be made without departing from the spirit and scope of the presentinvention as defined by the appended claims.

What is claimed is:
 1. An intra-prediction mode decoding method,comprising: determining whether an intra-prediction mode of a currentprediction unit (PU) is identical to a first candidate intra-predictionmode or a second candidate intra-prediction mode based on n-bitinformation; and when the intra-prediction mode of the current PU isidentical to at least one of the first candidate intra-prediction modeand the second candidate intra-prediction mode, determining which one ofthe first candidate intra-prediction mode and the second candidateintra-prediction mode the intra-prediction mode of the current PU isidentical to, based on additional m-bit information, and decoding theintra-prediction mode of the current PU.
 2. The intra-prediction modedecoding method of claim 1, further comprising: when theintra-prediction mode of the current PU is not identical to at least oneof the first candidate intra-prediction mode and the second candidateintra-prediction mode, decoding the intra-prediction mode of the currentPU based on additional bit specifying remaining intra-prediction modeinformation.
 3. The intra-prediction mode decoding method of claim 2,further comprising: when the intra-prediction mode value of the currentPU is greater than at least one of the first candidate intra-predictionmode value and the second candidate intra-prediction mode value,changing a codeword mapped to the intra-prediction mode value of thecurrent PU.
 4. The intra-prediction mode decoding method of claim 1,wherein when at least one of the first candidate intra-prediction modeand the second candidate intra-prediction mode is not derived from aneighbor PU of the current PU, a planar mode and a DC mode aresequentially set to at least one of the first candidate intra-predictionmode and the second candidate intra-prediction mode not derived from theneighbor PU of the current PU, so that the first candidateintra-prediction mode and the second candidate intra-prediction modehave different infra-prediction mode values.
 5. The intra-predictionmode decoding method of claim 1, wherein when a first neighbor PU and asecond neighbor PU of the current PU are available neighbor PUs, andintra-prediction mode values of the first neighbor PUs and the secondneighbor PU are identical, an intra-prediction mode value of the firstneighbor PU or an intra-prediction mode value of the second neighbor PUis set to a first candidate intra-prediction mode, and when one of thefirst neighbor PU and the second neighbor PU is available, anintra-prediction mode value of the available neighbor PU is set as afirst candidate intra-prediction mode, and when the first candidateinfra-prediction mode is not a planar mode, the second candidateintra-prediction mode is set as the planar mode, and when the firstcandidate intra-prediction mode is the planar mode, the second candidateintra-prediction mode is set as a DC mode.
 6. The intra-prediction modedecoding method of claim 1, wherein when neither of the first neighborPU and the second neighbor PU of the current PU are available, the firstcandidate intra-prediction mode may be set as the planar mode and thesecond candidate intra-prediction mode may be set as the DC mode.
 7. Theintra-prediction mode decoding method of claim 1, further comprising: ifthe number of intra-prediction modes used in the current PU is equal toor smaller than a predetermined number, calculating intra-predictionmode information of the current PU based on a codeword directly mappedto the intra-prediction mode, without determining the first candidateintra-prediction mode and the second candidate intra-prediction mode. 8.The intra-prediction mode decoding method of claim 1, wherein thedetermining of whether the intra-prediction mode of the current PU isidentical to the first candidate intra-prediction mode or the secondcandidate intra-prediction mode based on n-bit information comprises:when at least one of the first candidate intra-prediction mode value andthe second candidate intra-prediction mode value is greater than thenumber of intra-prediction modes available in the current PU, mapping atleast one candidate intra-prediction mode value greater than the numberof intra-prediction modes available in the current PU to theintra-prediction mode value available in the current PU by using apredetermined mapping table.
 9. The intra-prediction mode decodingmethod of claim 8, wherein the predetermined mapping table is set sothat a probability that at least one candidate intra-prediction modevalue greater than the number of intra-prediction modes available in thecurrent PU is mapped to the planar mode is high.
 10. Theintra-prediction mode decoding method of claim 8, wherein thepredetermined mapping table is set so that a probability that at leastone candidate intra-prediction mode value greater than the number ofintra-prediction modes available in the current PU is mapped to the DCmode is high.
 11. The intra-prediction mode decoding method of claim 1,wherein n and m are
 1. 12. A decoder comprising: an entropy decodingmodule configured to decode information regarding whether anintra-prediction mode of a current prediction unit (PU) is identical toa first candidate intra-prediction mode or a second candidateintra-prediction mode based on n-bit information included in apredetermined bit stream, decode information regarding as to which oneof the first candidate intra-prediction mode and the second candidateintra-prediction mode, the infra-prediction mode of the current PU isidentical to, based on additional m-bit information, when theintra-prediction mode of the current PU is identical to at least one ofthe first candidate intra-prediction mode and the second candidateintra-prediction mode, and decode the intra-prediction mode of thecurrent PU based on an additional bit specifying remainingintra-prediction mode information, when the intra-prediction mode of thecurrent PU is not identical to at least one of the first candidateintra-prediction mode and the second candidate intra-prediction mode;and a prediction module configured to perform intra-prediction based onthe intra-prediction mode of the current PU decoded by the entropydecoding module.
 13. The decoder of claim 12, wherein when at least oneof the first candidate intra-prediction mode and the second candidateintra-prediction mode are not derived from a neighbor PU of the currentPU, a planar mode and a DC mode are sequentially set to at least one ofthe first candidate intra-prediction mode and the second candidateintra-prediction mode not derived from the neighbor PU of the current PUsuch that the first candidate intra-prediction mode and the secondcandidate intra-prediction mode have different intra-prediction modevalues.
 14. The decoder of claim 12, wherein when a first neighbor PUand a second neighbor PU of the current PU are available neighbor PUs,and the intra-prediction mode values of the first neighbor PU and thesecond neighbor PU is identical, an intra-prediction mode value of thefirst neighbor PU or an intra-prediction mode value of the secondneighbor PU is set to a first candidate intra-prediction mode, and whenone of the first neighbor PU and the second neighbor PU is an availableneighbor PU, an intra-prediction mode value of the available neighbor PUis set as a first candidate intra-prediction mode, and when the firstcandidate intra-prediction mode is not a planar mode, the secondcandidate intra-prediction mode is set as the planar mode, and when thefirst candidate intra-prediction mode is the planar mode, the secondcandidate intra-prediction mode is set as a DC mode.
 15. The decoder ofclaim 12, wherein when at least one of the first candidateintra-prediction mode value and the second candidate intra-predictionmode value is greater than the number of intra-prediction modesavailable in the current PU, the prediction module maps at least onecandidate intra-prediction mode value greater than the number of theintra-prediction modes available in the current PU to theintra-prediction mode value available in the current PU to performintra-prediction on the current PU.
 16. The decoder of claim 15, whereinthe predetermined mapping table is set so that a probability that atleast one candidate intra-prediction mode value greater than the numberof intra-prediction modes available in the current PU is set mapped tothe planar mode is high.
 17. The decoder of claim 12, wherein n and mare 1.